package com.hexus.eve.utils;

import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {
	static Logger logger = Logger.getLogger(HibernateUtil.class);
	private static final SessionFactory sessionFactory;
	
    static { 
        try { 
            sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); 
        } catch (Throwable ex) { 
        	logger.error("Initial SessionFactory creation failed: " + ex);
            throw new ExceptionInInitializerError(ex); 
        } 
    } 

    public static SessionFactory getSessionFactory() { 
        return sessionFactory; 
    }
}
